<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>灯控系统</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
	
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap-switch.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
	<link rel="StyleSheet" href="${pageContext.request.contextPath}/css/table4jtheme/tabletree4j.css" type="text/css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/js/layer/skin/espresso/style.css"></link>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/js/layer/skin/layer.css" id="layui_layer_skinlayercss"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/jquery.ui.css"></link>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/base.css"></link>
	
	<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.0&key=5c7319868e7c245b3bd8f8b25d81fb20"></script>
	<script src="http://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
	<script src="${pageContext.request.contextPath}/js/jquery-1.12.4.min.js"></script>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/table4j/Core4j.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/table4j/TableTree4j.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-3.1.1.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/tether.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap-switch.js"></script>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ui.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/layer/ajaxloading.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/layer/layer.js"></script>
	
	<!-- <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"/> -->
    <style>
        html, body, #container {
            height: 100%;
            width: 100%;
        }

        .amap-marker:first-child .amap-icon img {
            width: 25px;
            height: 34px;
        }
    </style>
  </head>
  
  <body>
  	<input type="button" value="dddddd" onclick="xxx()" />
	<div id="container" style="display:none;"></div>
<!-- <script type="text/javascript"
        src="https://webapi.amap.com/maps?v=1.4.11&key=您申请的key值"></script>
 --><script type="text/javascript">
function xxx() {
    var map = new AMap.Map("container", {
        resizeEnable: true,
        center: [116.397428, 39.90923],
        zoom: 13
    });

    var marker = new AMap.Marker({
        position: map.getCenter(),
        icon: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
        offset: new AMap.Pixel(-13, -30),
        // 设置是否可以拖拽
        draggable: true,
        cursor: 'move',
        // 设置拖拽效果
        raiseOnDrag: false
    });
    
    var point = null;
    marker.on("dragend", function() {
    	// 重新获取点坐标
    	point = marker.getPosition();
    	console.log(point);
    	//弹出窗口
   	});

    marker.setMap(map);
    
    $("#container").show();
}
</script>
</body>
</html>
